package com.example.blog.module.controller;

import com.example.blog.module.entity.VO.Result;
import com.example.blog.module.service.FollowService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zjx
 * @since 2023-04-06
 */
@RestController
@RequiredArgsConstructor
public class FollowController {

    private final FollowService followService;

    /**
     * 关注/取消关注
     */
    @GetMapping("/follow/{id}")
    public Result follow(@PathVariable("id") String followUserId){
        return Result.success(followService.follow(Long.valueOf(followUserId)));
    }

    /**
     * 关注列表
     */
    @GetMapping("/queryFollow")
    public Result queryFollow(){
        return Result.success(followService.queryFollow());
    }

    /**
     * 粉丝列表
     */
    @GetMapping("/queryFans")
    public Result queryFans(){
        return Result.success(followService.queryFans());
    }


}

